
{include file="public/header"}

<body>
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post">
        <div class="ch-row ch-info-form">
            <div class="flex1">店长列表：</div>
            <div class="flex2">{$data.username}</div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">收入：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.income}" name="income">
                <input value="{$data.created_time}" name="created_time" type="hidden">
                <input value="{$data.user_id}" name="user_id" type="hidden">
                <input value="{$data.amount_id}" name="amount_id" type="hidden">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">底薪：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.di}" name="di" placeholder="请输入该月底薪">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">材料成本：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.material}" name="material">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">人工成本：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.labor}" name="labor">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">工程利润：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.engineering}" name="engineering">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">师傅工资：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.wages}" name="wages">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">房租：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.rents}" name="rents">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">办公费：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.office}" name="office">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">运费：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.freight}" name="freight">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">福利费：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.welfare}" name="welfare">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">水电物管费：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.water}" name="water">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">租金：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.rent}" name="rent">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">建渣清运费：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.slash}" name="slash">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">折旧费：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.depreciation}" name="depreciation">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">交通费：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.traffic}" name="traffic">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">营销费：</div>
            <div class="flex2">
                <input type="number" class="form-control fid" value="{$data.marketing}" name="marketing">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">
                <button class="btn btn-primary radius" style="width: 100% ;" type="button"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
            </div>
        </div>
    </form>
</div>

{include file="public/footer"}
<script>
    $('.radius').click(function () {
        var src = "{:Url('index/amount/edit')}";
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        $.ajax({
            type: 'POST',
            url: src,
            dataType: 'json',
            data: $('form').serializeArray(),
            success: function (data) {
                var res = JSON.parse(data);
                if (res.code == 200) {
                    layer.closeAll();
                    layer.msg(res.msg, {icon: 1, time: 2000}, function () {
                        setTimeout("window.parent.location.reload()", 1);
                    });
                } else {
                    layer.msg(res.msg, {icon: 5, time: 1000});
                }

            },
            error: function (data) {
                console.log(data.msg);
            },
        })
    });
</script>
</body>
</html>